#pragma once

#include <string>
#include <vector>
#include <memory>

#include "platform.h"
#include "MemoryBounds.h"
#include "MemoryReader.h"
#include "MemoryAddress.h"

class MemoryRegion
{
public:
	typedef std::shared_ptr<byte> shared_data;

	MemoryRegion(const MemoryBounds& bounds_, MemoryReader& reader);

	MemoryRegion(const MemoryRegion&& other);

	const MemoryBounds& bounds() const;

	shared_data data();

	const shared_data data() const;

	const MemoryAddress findString(const std::string& str, address_t offset = 0) const;

	const MemoryAddress findPattern(const std::string& pattern, const std::vector<byte>& bytes, const MemoryAddress offset = 0) const;

protected:
	MemoryBounds bounds_;
	shared_data data_;
};
